

# 39. 组合总和

def main(candidates,target):
    result = []
    temp = []
    def backtrack(candidates,target):
        sum = 0
        for j in range(0,len(temp)):
            sum = sum + temp[j]
        if sum == target:
            result.append(temp[:])
            return
        if sum > target:
            return
        for i in range(0,len(candidates)):
            temp.append(candidates[i])
            backtrack(candidates,target)
            temp.pop()
    backtrack(candidates,target)
    for i in range(0, len(result)):
        result[i].sort()
    results = []
    for i in range(0,len(result)):
        if result[i] not in results:
            results.append(result[i])
    if len(results) == 0:
        return []
    else:
        return results

if  __name__ == "__main__":
    arr = input()
    candidates = [int(i) for i in arr.split()]
    target = int(input())
    result = main(candidates,target)
    print(result)
